package com.tensquare.recruit.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.tensquare.recruit.pojo.Recruit;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RecruitDao  extends BaseMapper<Recruit> {
    // 查state=2且按日期降序排前4个
    @Select("SELECT * FROM tb_recruit WHERE state=2 ORDER BY createtime DESC LIMIT 4")
    List<Recruit> recommend();
   //查state=1且按日期降序排前12个
   @Select("SELECT * FROM tb_recruit WHERE state=1 ORDER BY createtime DESC LIMIT 12")
    List<Recruit> newlist();
}
